/**
 * Created by zhaiyunzhi on 2017/1/3.
 */
import api from './config'

export function addOrder(param) {
    return api.post('api/order/addOrder',{
        dscj_user_id:param.dscj_user_id,
        student_id:param.student_id,
        product_id:param.product_id,
        product_real_pay_price:param.product_real_pay_price,
        is_invoice:param.is_invoice,
        type:param.type,
        term:param.term,
        start_school_time:param.start_school_time,
        finish_school_time:param.finish_school_time,
        leave_school_time:param.leave_school_time,
        employment:param.employment,
        tutor:param.tutor,
        xg:param.xg,
        more:param.more,
        state:param.state
    });
}

export function updateOrder(param) {
    return api.post('api/order/updateOrder',{
        order_id:param.order_id,
        dscj_user_id:param.dscj_user_id,
        student_id:param.student_id,
        product_id:param.product_id,
        product_real_pay_price:param.product_real_pay_price,
        is_invoice:param.is_invoice,
        type:param.type,
        term:param.term,
        start_school_time:param.start_school_time,
        finish_school_time:param.finish_school_time,
        leave_school_time:param.leave_school_time,
        employment:param.employment,
        tutor:param.tutor,
        xg:param.xg,
        more:param.more,
        state:param.state
    });
}

export function getList(param) {
    return api.post('api/order/getList',{
       page_index:param.page_index,
       page_size:param.page_size,
       school:param.school,
       dealer_id:param.dealer_id,
       product_id:param.product_id,
       type:param.type,
       state:param.state,
       guid:param.guid
    });
}

export function getDetail(order_id) {
    return api.post('api/order/getDetail',{
        order_id:order_id
    });
}

export function switchState(order_id,state) {
    return api.post('api/order/switchState',{
        order_id:order_id,
        state:state
    });
}

